<template>
    <div class="app">
        <teleport to="#leon">
            <h2>当前计数</h2>
            <button>+1</button>
        </teleport>
    </div>
</template>

<script>
    import { getCurrentInstance } from 'vue';
    export default {
        setup() {
            // 安装一个Object插件 然后去获取他
            const instance = getCurrentInstance();
            console.log(instance.appContext.config.globalProperties.$name);
        },
        mounted() {
            console.log(this.$name);
        },
    }
</script>

<style scoped>

</style>